package com.epalmpay.service.bonus;

import com.epalmpay.entity.BonusSendLog;
import com.epalmpay.entity.BonusVerifyLog;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * Created by gwn on 2017/9/12.
 */
@Repository
public interface IBonusService {

    //给单个会员发积分(手动事物)
    public int sendOneMemberBonus(BonusSendLog bonusSendLog) throws Exception;

    //计划任务自动积分入账
    public int insertMemberBonus() throws Exception;

    //给单个会员积分进行核销(手动事物)
    public int verifyOneMemberBonus(BonusVerifyLog bonusVerifyLog,Integer payAmount) throws Exception;

    /***
     * 获取会员可用积分
     * @param memberId
     * @param shopId,交易门店,可空
     * @param payAmount,交易金额,可空
     * @return maxAvaiableBonus最大可用积分,valueAmount等值金额,verifyRate积分核销比例,minBonus最低积分点数
     * @throws Exception
     */
    public Map<String, Object> getMemberAvaiableBonus(Long memberId,Long shopId,Integer payAmount) throws Exception;
}
